import request from '@/utils/request'
import type { productListResponseData } from '@/api/product/tradmark/type.ts'
enum API {
  PRODUCTLIST_URL = '/admin/product/baseTrademark/',
  ADDTRADMARK_URL = '/admin/product/baseTrademark/save',
  UPDATETRADMARK_URL = '/admin/product/baseTrademark/update',
  DELETETRADMARK_URL = '/admin/product/baseTrademark/remove/'
}
export const reqProductList = (page: number, limit: number) => {
  return request.get<any, productListResponseData>(API.PRODUCTLIST_URL + `${page}/${limit}`)
}
export const reqAddAndUpdateTradmark = (data: any) => {
  if (data.id) {
    return request<any, any>({
      url: API.UPDATETRADMARK_URL,
      method: 'put',
      data
    })
  } else {
    return request<any, any>({
      url: API.ADDTRADMARK_URL,
      method: 'post',
      data
    })
  }
}
export const reqDeleteTradmark = (id: number) => {
  return request.delete<any, any>(API.DELETETRADMARK_URL + `${id}`)
}
